//
//  YBHomeLogoTableViewCell.m
//  ShangHaiHuDongApp
//
//  Created by apple on 18/4/3.
//  Copyright © 2018年 刘应平. All rights reserved.
//

#import "YBHomeLogoTableViewCell.h"
@interface YBHomeLogoTableViewCell ()
//标题
@property (nonatomic , strong) UIImageView * logoImageView;

@property (nonatomic , strong) TenGrayShadowView *under;

@end

@implementation YBHomeLogoTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initMyCell];
    }
    return self;
}




-(void)initMyCell{
    self.under = [[TenGrayShadowView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen zj_screenWith], 10 * [UIScreen zj_screenHScale])];
    self.under.backgroundColor = [UIColor themeGrayColor];
    self.under.isRemoveTop = YES;
    self.under.hidden = YES;
    [self.contentView addSubview:self.under];
    
    [self.contentView addSubview:self.logoImageView];
    
    self.logoImageView.sd_layout.leftSpaceToView(self.contentView , 0).bottomSpaceToView(self.contentView , 0).widthIs([UIScreen zj_screenWith]).heightIs(ItemHeight * 171);
    
}

-(void)setModel:(YBLogoDataModel *)model
{
    self.logoImageView.sd_layout.leftSpaceToView(self.contentView , 0).bottomSpaceToView(self.contentView , 0).widthIs([UIScreen zj_screenWith]).heightIs(ItemHeight * ([model.IOS_HEIGHT integerValue]));
    [self.logoImageView updateLayout];
    [self.logoImageView sd_setImageWithURL:CREATEURL(model.IOS_IMG_PATH) placeholderImage:[UIImage imageNamed:@"home_banner_placeholder"]];
    if (model.isTop) {
        self.under.hidden = YES;
    }
    else{
        self.under.hidden = NO;
    }
}





-(UIImageView *)logoImageView
{
    if (!_logoImageView) {
        _logoImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen zj_screenWith], ItemHeight * 171)];
    }
    return _logoImageView;
}

@end
